﻿@namespace BootstrapBlazor.Components
@typeparam TValue
@inherits BootstrapInputBase<TValue>

@if (IsShowLabel)
{
    <BootstrapLabel required="@Required" for="@Id" ShowLabelTooltip="ShowLabelTooltip" Value="@DisplayText" />
}
@if (ShowButton)
{
    <div class="input-group">
        <button class="@ButtonClassString" type="button" @onclick="OnClickDec" disabled="@Disabled">
            <i class="fa fa-fw fa-minus-circle"></i>
        </button>
        <input @attributes="AdditionalAttributes" step="@StepString" min="@Min" max="@Max" id="@Id" type="number" placeholder="@PlaceHolder" class="@InputClassString" disabled="@Disabled" @bind-value="@CurrentValueAsString" @bind-value:event="onchange" @onblur="@OnBlur" @ref="FocusElement" />
        <button class="@ButtonClassString" type="button" @onclick="OnClickInc" disabled="@Disabled">
            <i class="fa fa-fw fa-plus-circle"></i>
        </button>
    </div>
}
else
{
    <input @attributes="AdditionalAttributes" step="@StepString" min="@Min" max="@Max" id="@Id" type="number" placeholder="@PlaceHolder" class="@InputClassString" disabled="@Disabled" @bind-value="@CurrentValueAsString" @bind-value:event="onchange" @onblur="@OnBlur" @ref="FocusElement" />
}
<CascadingValue Value="this" IsFixed="true">
    @ChildContent
</CascadingValue>
